package com.main.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.main.dao.PersonJDBCDao;
import com.main.ui.model.Person;

public class JdbcPersonServiceImpl implements PersonService {

	@Autowired
	PersonJDBCDao personDao;
	
	@Override
	public boolean savePersonDetails(Person person) {
		return personDao.insertPerson(person);
	}

	@Override
	public Person getPersonDetails(Long personId) {
		return personDao.getPerson(personId);
	}

	@Override
	public List<Person> getAllPersons() {
		return personDao.getAllPersons();
	}

	@Override
	public boolean updatePersonDetails(Person person) {
		return personDao.updatePerson(person);
	}

	@Override
	public boolean deletePerson(Long personId) {
		return personDao.deletePerson(personId);
	}

}
